--[[-- Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
--
-- this file licensed under the Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
--
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
-- PURPOSE.
-- See the Mulan PSL v2 for more details.
--
-- Author: auto generate
-- Create: 2025-8-20
-- Description: DO NOT EDIT; Code generated by "ipmi_message.lua.mako"
]] --
local validate = require 'mc.validate'
local utils = require 'mc.utils'

local GetSecretNumber = {}

---@class MyAppIpmiCmds.GetSecretNumberReq
local TGetSecretNumberReq = {}
TGetSecretNumberReq.__index = TGetSecretNumberReq
TGetSecretNumberReq.group = {}

local function TGetSecretNumberReq_from_obj(obj)
    return setmetatable(obj, TGetSecretNumberReq)
end

function TGetSecretNumberReq.new()
    return TGetSecretNumberReq_from_obj({})
end
---@param obj MyAppIpmiCmds.GetSecretNumberReq
function TGetSecretNumberReq:init_from_obj(obj)

end

function TGetSecretNumberReq:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TGetSecretNumberReq.group)
end

TGetSecretNumberReq.from_obj = TGetSecretNumberReq_from_obj

TGetSecretNumberReq.proto_property = {}

TGetSecretNumberReq.default = {}

TGetSecretNumberReq.struct = {}

function TGetSecretNumberReq:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    TGetSecretNumberReq:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TGetSecretNumberReq.proto_property, errs, need_convert)
    return self
end

function TGetSecretNumberReq:unpack(_)
end

GetSecretNumber.GetSecretNumberReq = TGetSecretNumberReq

---@class MyAppIpmiCmds.GetSecretNumberRsp
---@field CompletionCode integer
---@field SecretNumber integer
local TGetSecretNumberRsp = {}
TGetSecretNumberRsp.__index = TGetSecretNumberRsp
TGetSecretNumberRsp.group = {}

local function TGetSecretNumberRsp_from_obj(obj)
    return setmetatable(obj, TGetSecretNumberRsp)
end

function TGetSecretNumberRsp.new(CompletionCode, SecretNumber)
    return TGetSecretNumberRsp_from_obj({CompletionCode = CompletionCode, SecretNumber = SecretNumber})
end
---@param obj MyAppIpmiCmds.GetSecretNumberRsp
function TGetSecretNumberRsp:init_from_obj(obj)
    self.CompletionCode = obj.CompletionCode
    self.SecretNumber = obj.SecretNumber
end

function TGetSecretNumberRsp:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TGetSecretNumberRsp.group)
end

TGetSecretNumberRsp.from_obj = TGetSecretNumberRsp_from_obj

TGetSecretNumberRsp.proto_property = {'CompletionCode', 'SecretNumber'}

TGetSecretNumberRsp.default = {0, 0}

TGetSecretNumberRsp.struct = {
    {name = 'CompletionCode', is_array = false, struct = nil}, {name = 'SecretNumber', is_array = false, struct = nil}
}

function TGetSecretNumberRsp:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'CompletionCode', self.CompletionCode, 'uint8', false, errs, need_convert)
    validate.Optional(prefix .. 'SecretNumber', self.SecretNumber, 'uint32', false, errs, need_convert)

    TGetSecretNumberRsp:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TGetSecretNumberRsp.proto_property, errs, need_convert)
    return self
end

function TGetSecretNumberRsp:unpack(_)
    return self.CompletionCode, self.SecretNumber
end

GetSecretNumber.GetSecretNumberRsp = TGetSecretNumberRsp

return GetSecretNumber
